/**
 * 格式化金额
 * @param val
 * @returns {string}
 */
export function formatMoney(val) {
    let num = parseFloat(val);
    if (isNaN(num)) {
        return '0.00';
    }
    num = num.toFixed(2);
    let arr = String(num).split('.');
    arr[0] = arr[0].replace(/(?=((?!\b)\d{3})+$)/g, ',');
    return arr.join('.');
}